package cn.com.lms.business.exam.persistence.entity;

import com.bnzj.core.json.DateDeserializer;
import com.bnzj.core.util.FbConstant;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import javax.persistence.*;
import java.util.Date;

@Entity
@Getter
@Setter
@Table(name = "bnz_exam_employee_exercise_subject")
@Schema(description = "用户练习答题")
public class EmployeeExerciseSubject {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Schema(description = "唯一标识")
    protected Long id;// 主键


    @Schema(description = "练习ID")
    @Column(name = "exercise_id")
    private Long exerciseId;


    @Schema(description = "试题ID")
    @Column(name = "subject_id")
    private Long subjectId;

    @Schema(description = "答案")
    @Column(name = "answer")
    private String answer;


    @Schema(description = "员工ID")
    @Column(name = "employee_id")
    private Long employeeId;

    @Column(name = "create_time", updatable = false)
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(pattern = FbConstant.DATETIME_FORMAT)
    @JsonDeserialize(using = DateDeserializer.class)
    @JsonFormat(pattern = FbConstant.DATETIME_FORMAT, timezone = "GMT+8")
    @Schema(description = "创建时间")
    protected Date createTime;// 创建时间

    @Column(name = "modify_time")
    @Temporal(TemporalType.TIMESTAMP)
    @DateTimeFormat(pattern = FbConstant.DATETIME_FORMAT)
    @JsonDeserialize(using = DateDeserializer.class)
    @JsonFormat(pattern = FbConstant.DATETIME_FORMAT, timezone = "GMT+8")
    @Schema(description = "修改时间")
    protected Date modifyTime;// 修改时间
}
